<?php
	include('../../config/config.php');
	$url = 'accessToken.data';
	$html = file_get_contents($url);
	$jsonObj = json_decode($html);
	$token = $jsonObj->access_token;
	$time = $jsonObj->expires_in;
	if(time()>$time && !empty($time)){
	    $gettoken = file_get_contents(constant('domainname').'/apptoken/token/get.php');
	    if(!empty($gettoken)){
	    header('location:echotoden.php');
    	}
	}else{
		echo $token;
	}
?>